#include <bits/stdc++.h>
#define N 1000000
using namespace std;
typedef pair<int, char> P;
// struct Node{
// 	int f;
// 	char c;
// };

int n;
int x[N], y[N];
char k[N];
int an[N];
int vis[N];
map< P, int > mp;
queue<int> q;

int main(){
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> x[i] >> y[i] >> k[i];
		vis[y[i]] = 1;
		P node;
		node.first = x[i], node.second = k[i];
		mp[node] = y[i];
	}
	int xn;
	for(int i = 0; i < n; i++){
		if(vis[x[i]] == 0){
			xn = x[i];
			break;
		}
	}
	int ans;
	q.push(xn);
	int pox = 0;
	while(!q.empty()){
		ans = q.front();
		q.pop();
		P nod;
		nod.first = ans, nod.second = 'L';
		if( mp.find(nod) != mp.end()){
			q.push(mp[nod]);
			pox ++;
		}else{
			break;
		}
		nod.second = 'R';
		if( mp.find(nod) != mp.end()){
			q.push(mp[nod]);
			pox ++;
		}else{
			break;
		}
	}
	if(pox == n){
		cout<<"Yes"<<endl;
	}else{
		cout<<"No"<<endl;
	}
	return 0;
}